﻿<controls:ChildWindow x:Class="LEEAAttendanceControl.Views.UserEdit"
           xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
           xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
           Width="450" Height="500">
    <Grid x:Name="LayoutRoot" Margin="2">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <Grid Grid.Row="0" HorizontalAlignment="Center" Margin="15" DataContext="{Binding}">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="100"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            
            <sdk:Label Content="First Name:" Grid.Column="0" Grid.Row="0" HorizontalAlignment="Left"
                       VerticalAlignment="Center" Margin="3"/>
            
            <TextBox x:Name="FirstNameBox" Grid.Column="1" Grid.Row="0" Width="150" Margin="3"
                     Text="{Binding FirstName, Mode=TwoWay, ValidatesOnExceptions=True, NotifyOnValidationError=True}"/>

            <sdk:Label Content="Last Name:" Grid.Column="0" Grid.Row="1" HorizontalAlignment="Left"
                       VerticalAlignment="Center" Margin="3"/>
            
            <TextBox x:Name="LastNameBox" Grid.Column="1" Grid.Row="1" Width="150" Margin="3"
                     Text="{Binding LastName, Mode=TwoWay, ValidatesOnExceptions=True, NotifyOnValidationError=True}"/>

            <sdk:Label Content="Role:" Grid.Column="0" Grid.Row="2" HorizontalAlignment="Left"
                       VerticalAlignment="Center" Margin="3,10,3,3"/>
            
            <ComboBox x:Name="RoleBox" Grid.Column="1" Grid.Row="2" Width="150" Margin="3,5,3,3" Height="25"
                      SelectionChanged="RoleBox_SelectionChanged" SelectedValuePath="RoleID" DisplayMemberPath="RoleName"
                      SelectedValue="{Binding Role, Mode=TwoWay, ValidatesOnExceptions=True, NotifyOnValidationError=True}"/>

            <sdk:Label Content="Login:" Grid.Column="0" Grid.Row="3" HorizontalAlignment="Left"
                       VerticalAlignment="Center" Margin="3,10,3,3"/>
            
            <TextBox x:Name="LoginBox" Grid.Column="1" Grid.Row="3" Width="150" Margin="3,5,3,3"
                     Text="{Binding Login, Mode=TwoWay, ValidatesOnExceptions=True, NotifyOnValidationError=True}"/>

            <sdk:Label Content="Password:" Grid.Column="0" Grid.Row="4" HorizontalAlignment="Left"
                       VerticalAlignment="Center" Margin="3"/>
            
            <PasswordBox x:Name="PassBox" Grid.Column="1" Grid.Row="4" Width="150" Margin="3,5,3,3"
                         Password="{Binding Password, Mode=TwoWay, ValidatesOnExceptions=True, NotifyOnValidationError=True}"/>

            <sdk:Label Content="Company:" Grid.Column="0" Grid.Row="5" HorizontalAlignment="Left"
                       VerticalAlignment="Center" Margin="3,10,3,3"/>
            
            <ComboBox x:Name="CompanyBox" Grid.Column="1" Grid.Row="5" Width="150" Margin="3,5,3,3" Height="25"
                      SelectionChanged="CompanyBox_SelectionChanged" SelectedValuePath="ID" DisplayMemberPath="CompanyName"
                      SelectedValue="{Binding CompanyID, Mode=TwoWay, ValidatesOnExceptions=True, NotifyOnValidationError=True}"/>

            <sdk:Label Content="Department:" Grid.Column="0" Grid.Row="6" HorizontalAlignment="Left"
                       VerticalAlignment="Center" Margin="3"/>
            
            <ComboBox x:Name="DepartmentBox" Grid.Column="1" Grid.Row="6" Width="150" Margin="3,5,3,3" Height="25"
                      SelectedValuePath="DepartmentID" DisplayMemberPath="DepartmentName"
                      SelectedValue="{Binding DepartmentID, Mode=TwoWay, ValidatesOnExceptions=True, NotifyOnValidationError=True}"/>

            <sdk:Label Content="Active:" Grid.Column="0" Grid.Row="7" HorizontalAlignment="Left"
                       VerticalAlignment="Center" Margin="3,10,3,3"/>
            
            <CheckBox x:Name="ActiveCheck" Grid.Column="1" Grid.Row="7" VerticalAlignment="Center" Margin="3,10,3,3"
                      IsChecked="{Binding Active, Mode=TwoWay, ValidatesOnExceptions=True, NotifyOnValidationError=True}"/>
        </Grid>
        
        <Button x:Name="SaveButton" Grid.Row="1" Content="Save" Width="70" Height="25" Margin="265,0,83,33"
                Click="SaveButton_Click"/>
        
        <sdk:ValidationSummary x:Name="ErrorSummary" Grid.Row="2" Height="120"/>
    </Grid>
</controls:ChildWindow>